﻿using UnityEngine;

public class Testbox : MonoBehaviour 
{
	UILabel label;
	UISprite icon;
	WrapContent.ItemInfo itemInfo;
	public void SetNumber(string num)
	{
		label = this.transform.GetChild(0).GetComponent<UILabel>();
		icon = this.transform.GetChild(1).GetComponent<UISprite>();
		label.text = num;
		//Debug.Log("Item:"+this.name);
	}

    public void SetData(WrapContent.ItemInfo info)
    {
		itemInfo = info;
		label.text = itemInfo.ID + " " + itemInfo.Name;
		icon.spriteName = info.spriteName;
		icon.MarkAsChanged();
    }

	void OnClick()
	{
		Debug.Log(string.Format("<color=red> ID:{0} Name:{1}</color>", itemInfo.ID, itemInfo.Name));
	}
}
